Skip to content

docs(backend): document prisma.config.ts and its role alongside schema.prisma - #1146

Merged
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
Fury03:docs/1095-prisma-config-onboarding
Aug 3, 2026
Merged

docs(backend): document prisma.config.ts and its role alongside schema.prisma#1146
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
Fury03:docs/1095-prisma-config-onboarding

Conversation

@Fury03

@Fury03 Fury03 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1095

Problem

backend/prisma.config.ts configures the Prisma CLI (schema path, migrations path, datasource URL) separately from the data model in backend/prisma/schema.prisma, but neither backend/README.md nor docs/DEVELOPMENT.md mentioned the file. A contributor debugging a prisma generate/prisma migrate quirk had no pointer to check it.

Changes

backend/README.md — new subsection under Prisma Database:

  • A table splitting responsibilities: schema.prisma owns the data model, prisma.config.ts owns CLI configuration.
  • Why it's a separate file: it's TypeScript evaluated by Node before the CLI runs, so it can read environment variables. Prisma 7 no longer auto-loads .env for CLI commands, which is why the file opens with import "dotenv/config".
  • What it currently sets (schema, migrations.path, datasource.url).
  • A short troubleshooting list for the failures that actually trace back to this file: missing/wrong DATABASE_URL, paths resolving relative to backend/, and the seed command still living in the legacy prisma.seed field of package.json rather than migrations.seed in the config.

docs/DEVELOPMENT.md — two links into that section:

  • In the backend database setup step, right after the prisma:generate / prisma:migrate commands.
  • In the Database migration issues troubleshooting list.

Out of scope

No changes to the Prisma config itself, and no migration to a different config format — docs only.

@Fury03

Fury03 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Note on the failing CI checks

The red checks here are pre-existing on main and unrelated to this PR.

main's own CI run — 30494417974, the merge commit for #1130, which is the base of this branch — fails with the identical set:

Job Cause on main
Backend CI ~20 tsc errors, mostly IndexerStateRow.createdAt missing in src/lib/indexer-state.ts, plus soroban-indexer.service.ts, soroban-event-worker.ts, admin-rate-limiter.middleware.ts, tests/stream.test.ts, tests/stream.validator.test.ts
Frontend CI eslint parsing errors in frontend/src/components/dashboard/dashboard-view.tsx, frontend/src/hooks/useIncomingStreams.test.ts, frontend/src/lib/dashboard.ts
Soroban Contracts CI cargo fmt diffs at contracts/stream_contract/src/test.rs:433 and :2709
Backend Docker Image CI fails during the backend build, same tsc errors
Backend npm test 14 failing tests across 6 files: indexer-state, soroban-event-worker, integration/admin-metrics, integration/stream-actions, integration/stream-lifecycle, integration/streams/withdraw

This PR changes only Markdown, so it cannot affect any of those jobs — a docs edit does not change cargo fmt output or TypeScript types.

Happy to open a separate PR fixing the main breakage if that would be useful, but it would touch files well outside this issue's scope, so I have kept it out of here.

@Fury03
Fury03 force-pushed the docs/1095-prisma-config-onboarding branch from faa0d2a to a215357 Compare August 1, 2026 11:28

@ogazboiz ogazboiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified against the real prisma.config.ts: the dotenv import, schema, migrations.path and datasource.url claims are all accurate, and the note that seeding still lives in the legacy prisma.seed field matches package.json. merging. if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@ogazboiz
ogazboiz merged commit dd18431 into LabsCrypt:main Aug 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants